package org.neptune.web.controller;

import org.neptune.api.request.SeckillRequest;
import org.neptune.api.response.SeckillResponse;
import org.neptune.common.response.ResponseBean;
import org.neptune.service.service.SeckillApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author lwl
 * @date 2019/7/18 19:00
 */
@Api(value = "秒杀测试接口", tags = "秒杀测试接口")
@RestController
@RequestMapping("/seckillApi")
public class SeckillApiController {

	@Autowired
	private SeckillApiService seckillApiService;

	@ApiOperation(value = "秒杀测试")
	@RequestMapping(value = "/seckillActionTest", method = RequestMethod.POST)
	public ResponseBean<SeckillResponse> seckillActionTest(SeckillRequest seckillRequest) {

		ResponseBean<SeckillResponse> response = new ResponseBean<SeckillResponse>();
		response.setResult(seckillApiService.seckillActionTest(seckillRequest));
		return response;
	}
}
